package com.hand.springcloud.service.impl;


import com.hand.springcloud.entities.Product;
import com.hand.springcloud.mapper.ProductMapper;
import com.hand.springcloud.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ Description   :  部门服务接口实现类 ProductServiceImpl
 * @ Author        :  xiong.yilin@hand-china.com
 * @ CreateDate    :  2019/9/6 14:26
 */
@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public boolean add(Product product) {
        return productMapper.addProduct(product);
    }

    @Override
    public Product get(Long id) {
        return productMapper.findById(id);
    }

    @Override
    public List<Product> list() {
        return productMapper.findAll();
    }
}
